package com.xatu.ego.myfaq.controller;

import com.github.pagehelper.PageHelper;
import com.xatu.ego.myfaq.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class IndexController {
    @Autowired
    private UserService userService;


    @RequestMapping(value = "/")
    public String home(Model model) {
        model.addAttribute("msg", "Hi~欢迎");
        return "home";
    }
    @RequestMapping("/login")
    public  String login(){
        return "login";
    }

    @RequestMapping("/index")
    public  String index(){
        return "index";
    }

    @RequestMapping("/admin")
    @ResponseBody
    public String hello(){
        return "hello admin";
    }

    @RequestMapping("/users")
    public String userList(Model model){

            return "users";
    }
}
